var Widget=function(Q){"use strict";var ti=Object.defineProperty;var ni=(Q,U,w)=>U in Q?ti(Q,U,{enumerable:!0,configurable:!0,writable:!0,value:w}):Q[U]=w;var Ge=(Q,U,w)=>ni(Q,typeof U!="symbol"?U+"":U,w);var U,w,Et,te,Ot,Dt,Ze,Je,Qe,Ye,At,_e={},Tt=[],rr=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,we=Array.isArray;function X(e,t){for(var n in t)e[n]=t[n];return e}function It(e){var t=e.parentNode;t&&t.removeChild(e)}function L(e,t,n){var r,a,i,o={};for(i in t)i=="key"?r=t[i]:i=="ref"?a=t[i]:o[i]=t[i];if(arguments.length>2&&(o.children=arguments.length>3?U.call(arguments,2):n),typeof e=="function"&&e.defaultProps!=null)for(i in e.defaultProps)o[i]===void 0&&(o[i]=e.defaultProps[i]);return ke(e,o,r,a,null)}function ke(e,t,n,r,a){var i={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:a??++Et,__i:-1,__u:0};return a==null&&w.vnode!=null&&w.vnode(i),i}function F(e){return e.children}function Y(e,t){this.props=e,this.context=t}function ne(e,t){if(t==null)return e.__?ne(e.__,e.__i+1):null;for(var n;tt&&te.sort(Ze));$e.__r=0}function Lt(e,t,n,r,a,i,o,s,u,c,d){var l,f,_,y,S,x=r&&r.__k||Tt,v=t.length;for(n.__d=u,ar(n,t,x),u=n.__d,l=0;l0?ke(a.type,a.props,a.key,a.ref?a.ref:null,a.__v):a)!=null?(a.__=e,a.__b=e.__b+1,s=ir(a,n,o,d),a.__i=s,i=null,s!==-1&&(d--,(i=n[s])&&(i.__u|=131072)),i==null||i.__v===null?(s==-1&&l--,typeof a.type!="function"&&(a.__u|=65536)):s!==o&&(s==o-1?l--:s==o+1?l++:s>o?d>u-o?l+=s-o:l--:s(u!=null&&!(131072&u.__u)?1:0))for(;o>=0||s=0){if((u=t[o])&&!(131072&u.__u)&&a==u.key&&i===u.type)return o;o--}if(s{const e=new Date;return e.setUTCHours(0,0,0,0),e.setDate(e.getDate()+1),e.toISOString()})();const ur=e=>"source"in e;var se,D,nt,qt,pe=0,Bt=[],I=w,zt=I.__b,Ut=I.__r,Wt=I.diffed,Gt=I.__c,Zt=I.unmount,Jt=I.__;function Se(e,t){I.__h&&I.__h(D,e,pe||t),pe=0;var n=D.__H||(D.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function re(e){return pe=1,dr(Xt,e)}function dr(e,t,n){var r=Se(se++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):Xt(void 0,t),function(s){var u=r.__N?r.__N[0]:r.__[0],c=r.t(u,s);u!==c&&(r.__N=[c,r.__[1]],r.__c.setState({}))}],r.__c=D,!D.u)){var a=function(s,u,c){if(!r.__c.__H)return!0;var d=r.__c.__H.__.filter(function(f){return!!f.__c});if(d.every(function(f){return!f.__N}))return!i||i.call(this,s,u,c);var l=!1;return d.forEach(function(f){if(f.__N){var _=f.__[0];f.__=f.__N,f.__N=void 0,_!==f.__[0]&&(l=!0)}}),!(!l&&r.__c.props===s)&&(!i||i.call(this,s,u,c))};D.u=!0;var i=D.shouldComponentUpdate,o=D.componentWillUpdate;D.componentWillUpdate=function(s,u,c){if(this.__e){var d=i;i=void 0,a(s,u,c),i=d}o&&o.call(this,s,u,c)},D.shouldComponentUpdate=a}return r.__N||r.__}function Ne(e,t){var n=Se(se++,3);!I.__s&&Kt(n.__H,t)&&(n.__=e,n.i=t,D.__H.__h.push(n))}function fr(e){return pe=5,Ee(function(){return{current:e}},[])}function Ee(e,t){var n=Se(se++,7);return Kt(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function Oe(e,t){return pe=8,Ee(function(){return e},t)}function Qt(e){var t=D.context[e.__c],n=Se(se++,9);return n.c=e,t?(n.__==null&&(n.__=!0,t.sub(D)),t.props.value):e.__}function _r(){for(var e;e=Bt.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(De),e.__H.__h.forEach(rt),e.__H.__h=[]}catch(t){e.__H.__h=[],I.__e(t,e.__v)}}I.__b=function(e){D=null,zt&&zt(e)},I.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Jt&&Jt(e,t)},I.__r=function(e){Ut&&Ut(e),se=0;var t=(D=e.__c).__H;t&&(nt===D?(t.__h=[],D.__h=[],t.__.forEach(function(n){n.__N&&(n.__=n.__N),n.i=n.__N=void 0})):(t.__h.forEach(De),t.__h.forEach(rt),t.__h=[],se=0)),nt=D},I.diffed=function(e){Wt&&Wt(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(Bt.push(t)!==1&&qt===I.requestAnimationFrame||((qt=I.requestAnimationFrame)||pr)(_r)),t.__H.__.forEach(function(n){n.i&&(n.__H=n.i),n.i=void 0})),nt=D=null},I.__c=function(e,t){t.some(function(n){try{n.__h.forEach(De),n.__h=n.__h.filter(function(r){return!r.__||rt(r)})}catch(r){t.some(function(a){a.__h&&(a.__h=[])}),t=[],I.__e(r,n.__v)}}),Gt&&Gt(e,t)},I.unmount=function(e){Zt&&Zt(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach(function(r){try{De(r)}catch(a){t=a}}),n.__H=void 0,t&&I.__e(t,n.__v))};var Yt=typeof requestAnimationFrame=="function";function pr(e){var t,n=function(){clearTimeout(r),Yt&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);Yt&&(t=requestAnimationFrame(n))}function De(e){var t=D,n=e.__c;typeof n=="function"&&(e.__c=void 0,n()),D=t}function rt(e){var t=D;e.__c=e.__(),D=t}function Kt(e,t){return!e||e.length!==t.length||t.some(function(n,r){return n!==e[r]})}function Xt(e,t){return typeof t=="function"?t(e):t}const he=(e,{general:{font1:t,font2:n,font3:r}},a)=>{const i=e==="font1"?t:e==="font2"?n:e==="font3"?r:e;return a&&i==="inherit"?"Arial, sans-serif":i},hr=({mode:e,onEnd:t,date:n})=>`| mode: ${e},${e==="date"?` endDate: ${n},`:""} onEnd: ${t}`,at=({widgetId:e,shouldShow:t,cause:n,timer:r})=>{console.log("%cGSC Countdown Timer App",`color: white; background: rgb(69,32,94); background: linear-gradient(111deg, rgba(69,32,94,1) 0%, rgba(177,39,39,1) 50%, rgba(252,176,69,1) 100%); font-size: 12px; font-weight: 600; border-radius: 6px; padding: 5px 10px;`,`ID: ${e??"N/A"} | show: ${t?"✅":"⛔"} | (${n}) ${r?hr(r):""}`)},en="gsc-countdown-app-token";class Ae{static parseTokenData(t){if(!t)return null;try{const n=JSON.parse(t);if(typeof n.access_token!="string"||n.access_token.length===0)throw"invalid token";return n}catch{return null}}static saveTokenData(t){try{localStorage.setItem(`${en}`,JSON.stringify(t))}catch{}}static getToken(){try{return this.parseTokenData(localStorage.getItem(`${en}`))}catch{return null}}}Ge(Ae,"fetchStorefrontToken",async()=>fetch(`/apps/blinks-app-proxy/storefront-token?shop=${window.Shopify.shop}`,{headers:{"Content-Type":"application/json"}}).then(t=>t.json()));const it="gsc-timer",tn=e=>e instanceof Date&&!Number.isNaN(e.getTime());class ve{static loadData(t){const n={endDate:null,closeDate:null,hash:null};try{const r=localStorage.getItem(`${it}-${t}`),a=JSON.parse(r??"{}"),i=new Date(a.endDate);tn(i)&&(n.endDate=i);const o=new Date(a.closeDate);tn(o)&&(n.closeDate=o),typeof a.hash=="string"&&(n.hash=a.hash)}catch{}return n}static saveData(t,n){try{const r=this.loadData(n);localStorage.setItem(`${it}-${n}`,JSON.stringify({...r,endDate:t.endDate.toISOString(),hash:t.hash}))}catch{}}static setCloseDate(t,n){try{const r=this.loadData(n);r&&localStorage.setItem(`${it}-${n}`,JSON.stringify({...r,closeDate:t.toISOString()}))}catch{}}}const nn=new Map().set("DM Sans, sans-serif","DM Sans").set("Space Grotesk, sans-serif","Space Grotesk").set("Inter, sans-serif","Inter").set("Eczar, serif","Eczar").set("Work Sans, sans-serif","Work Sans").set("Manrope, sans-serif","Manrope").set("Fira Sans, sans-serif","Fira Sans").set("PT Serif, serif","PT Serif, serif").set("Cardo, serif","Cardo").set("Lora, serif","Lora").set("Libre Franklin, sans-serif","Libre Franklin").set("Playfair Display, serif","Playfair Display").set("Roboto, sans-serif","Roboto").set("Roboto Mono, monospace","Roboto Mono").set("Anek Telugu, sans-serif","Anek Telugu").set("Quicksand, sans-serif","Quicksand").set("Cormorant, serif","Cormorant").set("Alegreya, serif","Alegreya").set("Poppins, sans-serif","Poppins").set("Oswald, sans-serif","Oswald").set("Raleway, sans-serif","Raleway").set("Lato, sans-serif","Lato").set("Fraunces, serif","Fraunces").set("Montserrat, sans-serif","Montserrat").set("Anton, sans-serif","Anton").set("Outfit, sans-serif","Outfit").set("Radley, sans-serif","Radley").set("Josefin Sans, sans-serif","Josefin Sans").set("Merriweather, serif","Merriweather").set("Lobster, sans-serif","Lobster").set("Dancing Script, cursive","Dancing Script").set("Pacifico, cursive","Pacifico").set("Italianno, cursive","Italianno").set("Old Standard TT, serif","Old Standard TT").set("Space Mono, monospace","Space Mono").set("Tenor Sans, sans-serif","Tenor Sans").set("Prata, serif","Prata").set("Sacramento, cursive","Sacramento").set("Chakra Petch, sans-serif","Chakra Petch").set("Pixelify Sans, sans-serif","Pixelify Sans").set("Satisfy, cursive","Satisfy").set("Amatic SC, cursive","Amatic SC").set("Alfa Slab One, cursive","Alfa Slab One").set("Righteous, cursive","Righteous").set("Yellowtail, cursive","Yellowtail").set("Bungee, cursive","Bungee").set("Silkscreen, cursive","Silkscreen").set("Rubik Bubbles, cursive","Rubik Bubbles").set("Luckiest Guy, cursive","Luckiest Guy").set("Squada One, cursive","Squada One").set("Special Elite, cursive","Special Elite").set("Matemasie, cursive","Matemasie").set("Fascinate Inline, cursive","Fascinate Inline").set("Honk, cursive","Honk").set("Nabla, cursive","Nabla").set("Rubic Dirt, system-ui","Rubic Dirt").set("Raleway Dots, sans-serif","Raleway Dots").set("Love Ya Like A Sister, cursive","Love Ya Like A Sister").set("Italiana, sans-serif","Italiana").set("Rye, serif","Rye").set("Tomorrow, sans-serif","Tomorrow").set("Chewy, system-ui","Chewy").set("Six Caps, sans-serif","Six Caps").set("Londrina Solid, sans-serif","Londrina Solid").set("Antonio, sans-serif","Antonio").set("Squada One, sans-serif","Squada One").set("Cabin Sketch, sans-serif","Cabin Sketch").set("Rubik Scribble, system-ui","Rubik Scribble").set("Freckle Face, system-ui","Freckle Face").set("Sancreek, serif","Sancreek").set("Stint Ultra Condensed, serif","Stint Ultra Condensed").set("Tourney, sans-serif","Tourney").set("Alumni Sans Inline One, sans-serif","Alumni Sans Inline One").set("Creepster, system-ui","Creepster").set("Eater, system-ui","Eater").set("Griffy, system-ui","Griffy").set("Mountains of Christmas, serif","Mountains of Christmas").set("Codystar, sans-serif","Codystar").set("Festive, cursive","Festive"),vr=e=>{const t=[...new Set(e)].reduce((r,a)=>{if(nn.has(a)){const i=`${nn.get(a).replace(/ +/g,"+")}:400,500,600,700,800,900`;return[...r,i]}return r},[]);if(t.length===0)return null;const n=document.createElement("link");return n.rel="stylesheet",n.href=`https://fonts.googleapis.com/css?family=${t.join("|")}`,n},gr=()=>{const{settings:e}=W(),{font1:t,font2:n,font3:r}=e.general;Ne(()=>{const a=vr([t,n,r]);return a&&document.head.appendChild(a),()=>{a&&document.head.removeChild(a)}},[t,n,r])},rn="background: transparent",an=(e,t)=>e&&parseInt(t)>0?`backdrop-filter: blur(${t}); -webkit-backdrop-filter: blur(${t});`:"",mr=({color:e,blur:t,enabled:n})=>{const r=rn;return n?{backgroundStyle:` background-color: ${e||"transparent"}; ${an(!0,t)}`,overlayStyle:r}:{backgroundStyle:"",overlayStyle:r}},yr=({enabled:e,source:t,src:n,bgColor:r,overlayColor:a,blur:i})=>{let o=rn;if(!e)return{backgroundStyle:"",overlayStyle:o};const s=t==="color",u=!!n;return o=`background: ${s?"transparent":a};`,{backgroundStyle:` background: ${s?r:u?`url(${n}) center / cover no-repeat`:"transparent"}; ${an(s,i)}`,overlayStyle:o}},ot=e=>ur(e)?yr(e):mr(e),A=e=>`${(e==null?void 0:e.top)||"0"} ${(e==null?void 0:e.right)||"0"} ${(e==null?void 0:e.bottom)||"0"} ${(e==null?void 0:e.left)||"0"}`,on=e=>({justify:e.endsWith("left")?"flex-start":e.endsWith("center")?"center":"flex-end",align:e.startsWith("top")?"flex-start":e.startsWith("center")?"center":"flex-end"}),sn=e=>{switch(e){case"left":return"flex-start";case"center":return"center";case"right":return"flex-end";default:return"initial"}},br=(e,t)=>{const{general:n,content:r,section:a,type:i}=e,o=on((a==null?void 0:a.contentDesktopPosition)||"center-center"),s=on((a==null?void 0:a.contentMobilePosition)||"center-center");return` .gta-widget.${t} { --gta-font1: ${n.font1}; --gta-font2: ${n.font2}; --gta-font3: ${n.font3}; --gta-banner-desktop-ratio: ${(a==null?void 0:a.desktopHeight)||"100%"}; --gta-banner-mobile-ratio: ${(a==null?void 0:a.mobileHeight)||"100%"}; --gta-banner-justify-content: ${o.justify}; --gta-banner-align-items: ${o.align}; --gta-content-direction: ${i==="bar"?"row":"column"}; --gta-content-wrap: ${i==="bar"?"wrap":"nowrap"}; --gta-content-desktop-width: ${r.desktopWidth}; --gta-content-mobile-width: 100%; --gta-content-desktop-gap: ${r.desktopGap}; --gta-content-mobile-gap: ${r.mobileGap}; } @media screen and (max-width: ${n.breakpoint}) { .gta-widget.${t} { --gta-banner-justify-content: ${s.justify}; --gta-banner-align-items: ${s.align}; } } `},ln=({title:e,body:t})=>h("div",{className:"gta-block__error",children:[h("div",{className:"gta-block__error-title",children:e}),h("div",{className:"gta-block__error-body",children:t})]}),st=e=>{if(!e||typeof e!="string")return null;const t=e.split("/");return t.length>1?t.pop():null},wr=(e,t=window.location.origin)=>{if(e.startsWith("/")||e.startsWith("./"))return e;let n;try{n=new URL(e).toString()}catch{try{n=new URL(`//${e}`,t).toString(),n===`https://${e}`&&(n=new URL(e,t).toString())}catch{n="#"}}return n},kr=e=>{if(!/^#([A-Fa-f0-9]{3}){1,2}$/.test(e))return e;let t;return t=e.substring(1).split(""),t.length==3&&(t=[t[0],t[0],t[1],t[1],t[2],t[2]]),t="0x"+t.join(""),"rgba("+[+t>>16&255,+t>>8&255,+t&255].join(",")+",1)"},lt=e=>{const t=/^rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d+(\.\d+)?)\s*\)$/.exec(kr(e));if(!t)return null;const n=parseInt(t[1],10),r=parseInt(t[2],10),a=parseInt(t[3],10),i=parseFloat(t[4]);return{r:n,g:r,b:a,a:i,rgb:`rgb(${n}, ${r}, ${a})`}};var j=(e=>(e.Home="home",e.Collection="collection",e.Product="product",e.Cart="cart",e.Account="account",e.SearchResults="searchresults",e.Page="page",e.Article="article",e.Password="password",e))(j||{});const be=class be{};Ge(be,"apply",async({pages:{home:t,products:n,collections:r,password:a,cart:i,other:o}})=>{const s=be.getMetaPage(),{product_tags:u=[],product_collections:c=[]}=window.GSC_COUNTDOWN_META||{},{pageType:d,resourceId:l}=s;if(d===j.Home&&t)return[!0,"home"];if(d===j.Password&&a)return[!0,"password"];if(d===j.Cart&&i)return[!0,"cart"];if(d===j.Product){if(!n.enabled)return[!1,"products_disabled"];if(n.mode==="all")return[!0,"all_products"];if(n.mode==="tags"){const f=n.tags.map(_=>_.toLowerCase().trim());return[(u||[]).some(_=>f.includes(_.toLowerCase().trim())),"product_tags"]}if(n.mode==="specific")return[n.specificProducts.some(f=>st(f.id)===(l==null?void 0:l.toString())),"specific_products"];if(n.mode==="productsInCollections"){const f=(c||[]).map(_=>_.id.toString());return[n.productsInCollections.some(_=>f.includes(st(_.id))),"product_in_collections"]}}return r.enabled&&d===j.Collection?r.enabled?r.mode==="all"?[!0,"all_collections"]:[r.items.some(f=>st(f.id)===(l==null?void 0:l.toString())),"specific_collection"]:[!1,"collections_disabled"]:o&&![j.Home,j.Password,j.Collection,j.Product,j.Cart].includes(d)?[!0,"other_page"]:[!1,"not_matched"]}),Ge(be,"getMetaPage",()=>{var n;const t=(n=window.ShopifyAnalytics)==null?void 0:n.meta.page;return t?(t.pageType||(window.document.location.pathname==="/cart"?t.pageType=j.Cart:window.document.location.pathname==="/account"&&(t.pageType=j.Account),t.pageType="page"),t):{pageType:"page"}});let ct=be;const cn=jt(void 0),W=()=>Qt(cn),un=e=>{try{let t=e==null?void 0:e.settings;if(typeof(e==null?void 0:e.settings)=="string"&&(t=JSON.parse((e==null?void 0:e.settings)||"")),t&&typeof t=="object"&&"content"in t)return(e==null?void 0:e.platform)==="Preview"&&(t={...t,general:{...t.general,breakpoint:e.isMobilePreview?"9999px":"1px"}}),t}catch{}return null},$r=({children:e,bootstrap:t})=>{var u,c,d;const[n,r]=re(un(t)),[a,i]=re(!1),o=(t==null?void 0:t.platform)==="Preview"||!1,s=(u=window.Shopify)==null?void 0:u.designMode;return Ne(()=>r(un(t)),[t]),Ne(()=>{if(n){if(!o&&(n==null?void 0:n.enabled)===!1){i(!1),at({widgetId:n.key,shouldShow:!1,cause:"widget_disabled"});return}if(o||s||!n.targeting){i(!0),at({widgetId:n.key,shouldShow:!0,cause:o?"is_preview":s?"is_theme_editor":"no_targeting",timer:n.timer});return}ct.apply(n.targeting).then(([l,f])=>{i(l),at({widgetId:n.key,shouldShow:l,cause:`targeting: ${f}`,timer:n.timer})})}},[n,o,s]),(c=window.Shopify)!=null&&c.designMode&&!(t!=null&&t.widgetId)?h(ln,{title:"Paste the Widget ID for the timer to appear.",body:"Widget will be hidden on the storefront."}):(d=window.Shopify)!=null&&d.designMode&&n&&(t==null?void 0:t.embed)===!1&&n.enabled===!1?h(ln,{title:"Enable widget in App admin",body:"Widget will be hidden on the storefront."}):!n||!a?null:h(cn.Provider,{value:{bootstrap:t||{},isPreview:(t==null?void 0:t.platform)==="Preview",settings:n},children:e})};var dn=()=>{},q=dn;function G(e){return{tag:0,0:e}}function ge(e){return{tag:1,0:e}}var fn=()=>typeof Symbol=="function"&&Symbol.asyncIterator||"@@asyncIterator",xr=e=>e;function P(e){return t=>n=>{var r=q;t(a=>{a===0?n(0):a.tag===0?(r=a[0],n(a)):e(a[0])?n(a):r(0)})}}function me(e){return t=>n=>t(r=>{r===0||r.tag===0?n(r):n(ge(e(r[0])))})}function _n(e){return t=>n=>{var r=[],a=q,i=!1,o=!1;t(s=>{o||(s===0?(o=!0,r.length||n(0)):s.tag===0?a=s[0]:(i=!1,function(c){var d=q;c(l=>{if(l===0){if(r.length){var f=r.indexOf(d);f>-1&&(r=r.slice()).splice(f,1),r.length||(o?n(0):i||(i=!0,a(0)))}}else l.tag===0?(r.push(d=l[0]),d(0)):r.length&&(n(l),d(0))})}(e(s[0])),i||(i=!0,a(0))))}),n(G(s=>{if(s===1){o||(o=!0,a(1));for(var u=0,c=r,d=r.length;un=>{var r=!1;t(a=>{if(!r)if(a===0)r=!0,n(0),e();else if(a.tag===0){var i=a[0];n(G(o=>{o===1?(r=!0,i(1),e()):i(o)}))}else n(a)})}}function Te(e){return t=>n=>{var r=!1;t(a=>{if(!r)if(a===0)r=!0,n(0);else if(a.tag===0){var i=a[0];n(G(o=>{o===1&&(r=!0),i(o)}))}else e(a[0]),n(a)})}}function ut(e){return t=>n=>t(r=>{r===0?n(0):r.tag===0?(n(r),e()):n(r)})}function ye(e){var t=[],n=q,r=!1;return a=>{t.push(a),t.length===1&&e(i=>{if(i===0){for(var o=0,s=t,u=t.length;o{if(i===1){var o=t.indexOf(a);o>-1&&(t=t.slice()).splice(o,1),t.length||n(1)}else r||(r=!0,n(0))}))}}function hn(e){return t=>n=>{var r=q,a=q,i=!1,o=!1,s=!1,u=!1;t(c=>{u||(c===0?(u=!0,s||n(0)):c.tag===0?r=c[0]:(s&&(a(1),a=q),i?i=!1:(i=!0,r(0)),function(l){s=!0,l(f=>{s&&(f===0?(s=!1,u?n(0):i||(i=!0,r(0))):f.tag===0?(o=!1,(a=f[0])(0)):(n(f),o?o=!1:a(0)))})}(e(c[0]))))}),n(G(c=>{c===1?(u||(u=!0,r(1)),s&&(s=!1,a(1))):(!u&&!i&&(i=!0,r(0)),s&&!o&&(o=!0,a(0)))}))}}function dt(e){return t=>n=>{var r=q,a=!1,i=0;t(o=>{a||(o===0?(a=!0,n(0)):o.tag===0?r=o[0]:i++=e&&(a=!0,n(0),r(1))):n(o))}),n(G(o=>{o===1&&!a?(a=!0,r(1)):o===0&&!a&&in=>{var r=q,a=q,i=!1;t(o=>{i||(o===0?(i=!0,a(1),n(0)):o.tag===0?(r=o[0],e(s=>{s===0||(s.tag===0?(a=s[0])(0):(i=!0,a(1),r(1),n(0)))})):n(o))}),n(G(o=>{o===1&&!i?(i=!0,r(1),a(1)):i||r(0)}))}}function Sr(e,t){return n=>r=>{var a=q,i=!1;n(o=>{i||(o===0?(i=!0,r(0)):o.tag===0?(a=o[0],r(o)):e(o[0])?r(o):(i=!0,r(o),r(0),a(1)))})}}function Nr(e){return t=>e()(t)}function gn(e){return t=>{var n=e[fn()]&&e[fn()]()||e,r=!1,a=!1,i=!1,o;t(G(async s=>{if(s===1)r=!0,n.return&&n.return();else if(a)i=!0;else{for(i=a=!0;i&&!r;)if((o=await n.next()).done)r=!0,n.return&&await n.return(),t(0);else try{i=!1,t(ge(o.value))}catch(u){if(n.throw)(r=!!(await n.throw(u)).done)&&t(0);else throw u}a=!1}}))}}function Er(e){return e[Symbol.asyncIterator]?gn(e):t=>{var n=e[Symbol.iterator](),r=!1,a=!1,i=!1,o;t(G(s=>{if(s===1)r=!0,n.return&&n.return();else if(a)i=!0;else{for(i=a=!0;i&&!r;)if((o=n.next()).done)r=!0,n.return&&n.return(),t(0);else try{i=!1,t(ge(o.value))}catch(u){if(n.throw)(r=!!n.throw(u).done)&&t(0);else throw u}a=!1}}))}}var Or=Er;function ft(e){return t=>{var n=!1;t(G(r=>{r===1?n=!0:n||(n=!0,t(ge(e)),t(0))}))}}function Dr(e){return t=>{var n=!1,r=e({next(a){n||t(ge(a))},complete(){n||(n=!0,t(0))}});t(G(a=>{a===1&&!n&&(n=!0,r())}))}}function Ie(){var e,t;return{source:ye(Dr(n=>(e=n.next,t=n.complete,dn))),next(n){e&&e(n)},complete(){t&&t()}}}function Me(e){return t=>{var n=q,r=!1;return t(a=>{a===0?r=!0:a.tag===0?(n=a[0])(0):r||(e(a[0]),n(0))}),{unsubscribe(){r||(r=!0,n(1))}}}}function Ar(e){Me(t=>{})(e)}function mn(e){return new Promise(t=>{var n=q,r;e(a=>{a===0?Promise.resolve(r).then(t):a.tag===0?(n=a[0])(0):(r=a[0],n(0))})})}var le={NAME:"Name",DOCUMENT:"Document",OPERATION_DEFINITION:"OperationDefinition",VARIABLE_DEFINITION:"VariableDefinition",SELECTION_SET:"SelectionSet",FIELD:"Field",ARGUMENT:"Argument",FRAGMENT_SPREAD:"FragmentSpread",INLINE_FRAGMENT:"InlineFragment",FRAGMENT_DEFINITION:"FragmentDefinition",VARIABLE:"Variable",INT:"IntValue",FLOAT:"FloatValue",STRING:"StringValue",BOOLEAN:"BooleanValue",NULL:"NullValue",ENUM:"EnumValue",LIST:"ListValue",OBJECT:"ObjectValue",OBJECT_FIELD:"ObjectField",DIRECTIVE:"Directive",NAMED_TYPE:"NamedType",LIST_TYPE:"ListType",NON_NULL_TYPE:"NonNullType"};class _t extends Error{constructor(t,n,r,a,i,o,s){super(t),this.name="GraphQLError",this.message=t,i&&(this.path=i),n&&(this.nodes=Array.isArray(n)?n:[n]),r&&(this.source=r),a&&(this.positions=a),o&&(this.originalError=o);var u=s;if(!u&&o){var c=o.extensions;c&&typeof c=="object"&&(u=c)}this.extensions=u||{}}toJSON(){return{...this,message:this.message}}toString(){return this.message}get[Symbol.toStringTag](){return"GraphQLError"}}var C,b;function T(e){return new _t(`Syntax Error: Unexpected token at ${b} in ${e}`)}function B(e){if(e.lastIndex=b,e.test(C))return C.slice(b,b=e.lastIndex)}var Le=/ +(?=[^\s])/y;function Tr(e){for(var t=e.split(` `),n="",r=0,a=0,i=t.length-1,o=0;o80?t+="("+(J+=" ")+H(e.arguments,J,M.Argument)+(J=J.slice(0,-2))+")":t+="("+n+")"}return e.directives&&e.directives.length&&(t+=" "+H(e.directives," ",M.Directive)),e.selectionSet&&(t+=" "+M.SelectionSet(e.selectionSet)),t},StringValue(e){return e.block?Hr(e.value).replace(/\n/g,J):Rr(e.value)},BooleanValue:e=>""+e.value,NullValue:e=>"null",IntValue:e=>e.value,FloatValue:e=>e.value,EnumValue:e=>e.value,Name:e=>e.value,Variable:e=>"$"+e.name.value,ListValue:e=>"["+H(e.values,", ",K)+"]",ObjectValue:e=>"{"+H(e.fields,", ",M.ObjectField)+"}",ObjectField:e=>e.name.value+": "+K(e.value),Document(e){return!e.definitions||!e.definitions.length?"":H(e.definitions,` `,K)},SelectionSet:e=>"{"+(J+=" ")+H(e.selections,J,K)+(J=J.slice(0,-2))+"}",Argument:e=>e.name.value+": "+K(e.value),FragmentSpread(e){var t="..."+e.name.value;return e.directives&&e.directives.length&&(t+=" "+H(e.directives," ",M.Directive)),t},InlineFragment(e){var t="...";return e.typeCondition&&(t+=" on "+e.typeCondition.name.value),e.directives&&e.directives.length&&(t+=" "+H(e.directives," ",M.Directive)),t+=" "+M.SelectionSet(e.selectionSet)},FragmentDefinition(e){var t="fragment "+e.name.value;return t+=" on "+e.typeCondition.name.value,e.directives&&e.directives.length&&(t+=" "+H(e.directives," ",M.Directive)),t+" "+M.SelectionSet(e.selectionSet)},Directive(e){var t="@"+e.name.value;return e.arguments&&e.arguments.length&&(t+="("+H(e.arguments,", ",M.Argument)+")"),t},NamedType:e=>e.name.value,ListType:e=>"["+K(e.type)+"]",NonNullType:e=>K(e.type)+"!"},K=e=>M[e.kind](e);function jr(e){return J=` `,M[e.kind]?M[e.kind](e):""}var qr={},Br=e=>e&&typeof e.message=="string"&&(e.extensions||e.name==="GraphQLError")?e:typeof e=="object"&&typeof e.message=="string"?new _t(e.message,e.nodes,e.source,e.positions,e.path,e,e.extensions||{}):new _t(e);class gt extends Error{constructor(t){var n=(t.graphQLErrors||[]).map(Br),r=((a,i)=>{var o="";if(a)return`[Network] ${a.message}`;if(i)for(var s of i)o&&(o+=` `),o+=`[GraphQL] ${s.message}`;return o})(t.networkError,n);super(r),this.name="CombinedError",this.message=r,this.graphQLErrors=n,this.networkError=t.networkError,this.response=t.response}toString(){return this.message}}var Ve=(e,t)=>{for(var n=0|(t||5381),r=0,a=0|e.length;r{if(e===null||ie.has(e))return"null";if(typeof e!="object")return JSON.stringify(e)||"";if(e.toJSON)return ue(e.toJSON(),t);if(Array.isArray(e)){var n="[";for(var r of e)n.length>1&&(n+=","),n+=ue(r,t)||"null";return n+="]"}else if(!t&&(He!==de&&e instanceof He||je!==de&&e instanceof je))return"null";var a=Object.keys(e).sort();if(!a.length&&e.constructor&&Object.getPrototypeOf(e).constructor!==Object.prototype.constructor){var i=bn.get(e)||Math.random().toString(36).slice(2);return bn.set(e,i),ue({__key:i},t)}ie.add(e);var o="{";for(var s of a){var u=ue(e[s],t);u&&(o.length>1&&(o+=","),o+=ue(s,t)+":"+u)}return ie.delete(e),o+="}"},mt=(e,t,n)=>{if(!(n==null||typeof n!="object"||n.toJSON||ie.has(n)))if(Array.isArray(n))for(var r=0,a=n.length;r(ie.clear(),ue(e,t||!1));class de{}var He=typeof File<"u"?File:de,je=typeof Blob<"u"?Blob:de,zr=/("{3}[\s\S]*"{3}|"(?:\\.|[^"])*")/g,Ur=/(?:#[^\n\r]+)?(?:[\r\n]+|$)/g,Wr=(e,t)=>t%2==0?e.replace(Ur,` `):e,wn=e=>e.split(zr).map(Wr).join("").trim(),kn=new Map,qe=new Map,yt=e=>{var t;return typeof e=="string"?t=wn(e):e.loc&&qe.get(e.__key)===e?t=e.loc.source.body:(t=kn.get(e)||wn(jr(e)),kn.set(e,t)),typeof e!="string"&&!e.loc&&(e.loc={start:0,end:t.length,source:{body:t,name:"gql",locationOffset:{line:1,column:1}}}),t},$n=e=>{var t;if(e.documentId)t=Ve(e.documentId);else if(t=Ve(yt(e)),e.definitions){var n=Cn(e);n&&(t=Ve(` # ${n}`,t))}return t},xn=e=>{var t,n;return typeof e=="string"?(t=$n(e),n=qe.get(t)||Vr(e)):(t=e.__key||$n(e),n=qe.get(t)||e),n.loc||yt(n),n.__key=t,qe.set(t,n),n},Be=(e,t,n)=>{var r=t||{},a=xn(e),i=Re(r,!0),o=a.__key;return i!=="{}"&&(o=Ve(i,o)),{key:o,query:a,variables:r,extensions:n}},Cn=e=>{for(var t of e.definitions)if(t.kind===le.OPERATION_DEFINITION)return t.name?t.name.value:void 0},Gr=e=>{for(var t of e.definitions)if(t.kind===le.OPERATION_DEFINITION)return t.operation},bt=(e,t,n)=>{if(!("data"in t||"errors"in t&&Array.isArray(t.errors)))throw new Error("No Content");var r=e.kind==="subscription";return{operation:e,data:t.data,error:Array.isArray(t.errors)?new gt({graphQLErrors:t.errors,response:n}):void 0,extensions:t.extensions?{...t.extensions}:void 0,hasNext:t.hasNext==null?r:t.hasNext,stale:!1}},wt=(e,t)=>{if(typeof e=="object"&&e!=null&&(!e.constructor||e.constructor===Object||Array.isArray(e))){e=Array.isArray(e)?[...e]:{...e};for(var n of Object.keys(t))e[n]=wt(e[n],t[n]);return e}return t},Zr=(e,t,n,r)=>{var a=e.error?e.error.graphQLErrors:[],i=!!e.extensions||!!(t.payload||t).extensions,o={...e.extensions,...(t.payload||t).extensions},s=t.incremental;"path"in t&&(s=[t]);var u={data:e.data};if(s){var c=function(l){Array.isArray(l.errors)&&a.push(...l.errors),l.extensions&&(Object.assign(o,l.extensions),i=!0);var f="data",_=u,y=[];if(l.path)y=l.path;else if(r){var S=r.find(m=>m.id===l.id);l.subPath?y=[...S.path,...l.subPath]:y=S.path}for(var x=0,v=y.length;x=0?f:0,N=0,p=l.items.length;N({operation:e,data:void 0,error:new gt({networkError:t,response:n}),extensions:void 0,hasNext:!1,stale:!1});function Jr(e){var t={query:void 0,documentId:void 0,operationName:Cn(e.query),variables:e.variables||void 0,extensions:e.extensions};return"documentId"in e.query&&e.query.documentId&&(!e.query.definitions||!e.query.definitions.length)?t.documentId=e.query.documentId:(!e.extensions||!e.extensions.persistedQuery||e.extensions.persistedQuery.miss)&&(t.query=yt(e.query)),t}var Qr=(e,t)=>{var n=e.kind==="query"&&e.context.preferGetMethod;if(!n||!t)return e.context.url;var r=Yr(e.context.url);for(var a in t){var i=t[a];i&&r[1].set(a,typeof i=="object"?Re(i):i)}var o=r.join("?");return o.length>2047&&n!=="force"?(e.context.preferGetMethod=!1,e.context.url):o},Yr=e=>{var t=e.indexOf("?");return t>-1?[e.slice(0,t),new URLSearchParams(e.slice(t+1))]:[e,new URLSearchParams]},Kr=(e,t)=>{if(t&&!(e.kind==="query"&&e.context.preferGetMethod)){var n=Re(t),r=(s=>{var u=new Map;return(He!==de||je!==de)&&(ie.clear(),mt(u,"variables",s)),u})(t.variables);if(r.size){var a=new FormData;a.append("operations",n),a.append("map",Re({...[...r.keys()].map(s=>[s])}));var i=0;for(var o of r.values())a.append(""+i++,o);return a}return n}},Xr=(e,t)=>{var n={accept:e.kind==="subscription"?"text/event-stream, multipart/mixed":"application/graphql-response+json, application/graphql+json, application/json, text/event-stream, multipart/mixed"},r=(typeof e.context.fetchOptions=="function"?e.context.fetchOptions():e.context.fetchOptions)||{};if(r.headers)if((o=>"has"in o&&!Object.keys(o).length)(r.headers))r.headers.forEach((o,s)=>{n[s]=o});else if(Array.isArray(r.headers))r.headers.forEach((o,s)=>{Array.isArray(o)?n[o[0]]?n[o[0]]=`${n[o[0]]},${o[1]}`:n[o[0]]=o[1]:n[s]=o});else for(var a in r.headers)n[a.toLowerCase()]=r.headers[a];var i=Kr(e,t);return typeof i=="string"&&!n["content-type"]&&(n["content-type"]="application/json"),{...r,method:i?"POST":"GET",body:i,headers:n}},ea=typeof TextDecoder<"u"?new TextDecoder:null,ta=/boundary="?([^=";]+)"?/i,na=/data: ?([^\n]+)/,Nn=e=>e.constructor.name==="Buffer"?e.toString():ea.decode(e);async function*En(e){if(e.body[Symbol.asyncIterator])for await(var t of e.body)yield Nn(t);else{var n=e.body.getReader(),r;try{for(;!(r=await n.read()).done;)yield Nn(r.value)}finally{n.cancel()}}}async function*On(e,t){var n="",r;for await(var a of e)for(n+=a;(r=n.indexOf(t))>-1;)yield n.slice(0,r),n=n.slice(r+t.length)}async function*ra(e,t,n){var r=!0,a=null,i;try{yield await Promise.resolve();var o=(i=await(e.context.fetch||fetch)(t,n)).headers.get("Content-Type")||"",s;/multipart\/mixed/i.test(o)?s=async function*(l,f){var _=l.match(ta),y="--"+(_?_[1]:"-"),S=!0,x;for await(var v of On(En(f),`\r `+y)){if(S){S=!1;var k=v.indexOf(y);if(k>-1)v=v.slice(k+y.length);else continue}try{yield x=JSON.parse(v.slice(v.indexOf(`\r \r `)+4))}catch(N){if(!x)throw N}if(x&&x.hasNext===!1)break}x&&x.hasNext!==!1&&(yield{hasNext:!1})}(o,i):/text\/event-stream/i.test(o)?s=async function*(l){var f;for await(var _ of On(En(l),` `)){var y=_.match(na);if(y){var S=y[1];try{yield f=JSON.parse(S)}catch(x){if(!f)throw x}if(f&&f.hasNext===!1)break}}f&&f.hasNext!==!1&&(yield{hasNext:!1})}(i):/text\//i.test(o)?s=async function*(l){var f=await l.text();try{var _=JSON.parse(f);qr.NODE_ENV!=="production"&&console.warn('Found response with content-type "text/plain" but it had a valid "application/json" response.'),yield _}catch{throw new Error(f)}}(i):s=async function*(l){yield JSON.parse(await l.text())}(i);var u;for await(var c of s)c.pending&&!a?u=c.pending:c.pending&&(u=[...u,...c.pending]),a=a?Zr(a,c,i,u):bt(e,c,i),r=!1,yield a,r=!0;a||(yield a=bt(e,{},i))}catch(d){if(!r)throw d;yield Sn(e,i&&(i.status<200||i.status>=300)&&i.statusText?new Error(i.statusText):d,i)}}function aa(e,t,n){var r;return typeof AbortController<"u"&&(n.signal=(r=new AbortController).signal),pn(()=>{r&&r.abort()})(P(a=>!!a)(gn(ra(e,t,n))))}var R={},kt=(e,t)=>{if(Array.isArray(e))for(var n of e)kt(n,t);else if(typeof e=="object"&&e!==null)for(var r in e)r==="__typename"&&typeof e[r]=="string"?t.add(e[r]):kt(e[r],t);return t},$t=e=>{if("definitions"in e){var t=[];for(var n of e.definitions){var r=$t(n);t.push(r)}return{...e,definitions:t}}if("directives"in e&&e.directives&&e.directives.length){var a=[],i={};for(var o of e.directives){var s=o.name.value;s[0]!=="_"?a.push(o):s=s.slice(1),i[s]=o}e={...e,directives:a,_directives:i}}if("selectionSet"in e){var u=[],c=e.kind===le.OPERATION_DEFINITION;if(e.selectionSet){for(var d of e.selectionSet.selections||[]){c=c||d.kind===le.FIELD&&d.name.value==="__typename"&&!d.alias;var l=$t(d);u.push(l)}return c||u.push({kind:le.FIELD,name:{kind:le.NAME,value:"__typename"},_generated:!0}),{...e,selectionSet:{...e.selectionSet,selections:u}}}}return e},Dn=new Map,ia=e=>{var t=xn(e),n=Dn.get(t.__key);return n||(Dn.set(t.__key,n=$t(t)),Object.defineProperty(n,"__key",{value:t.__key,enumerable:!1})),n};function An(e){var t=n=>e(n);return t.toPromise=()=>mn(dt(1)(P(n=>!n.stale&&!n.hasNext)(t))),t.then=(n,r)=>t.toPromise().then(n,r),t.subscribe=n=>Me(n)(t),t}function oe(e,t,n){return{...t,kind:e,context:t.context?{...t.context,...n}:n||t.context}}var Tn=(e,t)=>oe(e.kind,e,{meta:{...e.context.meta,...t}}),oa=()=>{},xt=({kind:e})=>e!=="mutation"&&e!=="query",sa=e=>{var t=ia(e.query);if(t!==e.query){var n=oe(e.kind,e);return n.query=t,n}else return e},la=({forward:e,client:t,dispatchDebug:n})=>{var r=new Map,a=new Map,i=o=>o.kind==="query"&&o.context.requestPolicy!=="network-only"&&(o.context.requestPolicy==="cache-only"||r.has(o.key));return o=>{var s=me(c=>{var d=r.get(c.key);R.NODE_ENV!=="production"&&n({operation:c,...d?{type:"cacheHit",message:"The result was successfully retried from the cache"}:{type:"cacheMiss",message:"The result could not be retrieved from the cache"},source:"cacheExchange"});var l=d||bt(c,{data:null});return l={...l,operation:R.NODE_ENV!=="production"?Tn(c,{cacheOutcome:d?"hit":"miss"}):c},c.context.requestPolicy==="cache-and-network"&&(l.stale=!0,In(t,c)),l})(P(c=>!xt(c)&&i(c))(o)),u=Te(c=>{var{operation:d}=c;if(d){var l=d.context.additionalTypenames||[];if(c.operation.kind!=="subscription"&&(l=(m=>[...kt(m,new Set)])(c.data).concat(l)),c.operation.kind==="mutation"||c.operation.kind==="subscription"){var f=new Set;R.NODE_ENV!=="production"&&n({type:"cacheInvalidation",message:`The following typenames have been invalidated: ${l}`,operation:d,data:{typenames:l,response:c},source:"cacheExchange"});for(var _=0;_c.kind!=="query"||c.context.requestPolicy!=="cache-only")(me(c=>R.NODE_ENV!=="production"?Tn(c,{cacheOutcome:"miss"}):c)(ae([me(sa)(P(c=>!xt(c)&&!i(c))(o)),P(c=>xt(c))(o)])))));return ae([s,u])}},In=(e,t)=>e.reexecuteOperation(oe(t.kind,t,{requestPolicy:"network-only"})),ca=({forward:e,dispatchDebug:t})=>n=>{var r=_n(i=>{var o=Jr(i),s=Qr(i,o),u=Xr(i,o);R.NODE_ENV!=="production"&&t({type:"fetchRequest",message:"A fetch request is being executed.",operation:i,data:{url:s,fetchOptions:u},source:"fetchExchange"});var c=vn(P(d=>d.kind==="teardown"&&d.key===i.key)(n))(aa(i,s,u));return R.NODE_ENV!=="production"?Te(d=>{var l=d.data?void 0:d.error;R.NODE_ENV!=="production"&&t({type:l?"fetchError":"fetchSuccess",message:`A ${l?"failed":"successful"} fetch response has been returned.`,operation:i,data:{url:s,fetchOptions:u,value:l||d},source:"fetchExchange"})})(c):c})(P(i=>i.kind!=="teardown"&&(i.kind!=="subscription"||!!i.context.fetchSubscriptions))(n)),a=e(P(i=>i.kind==="teardown"||i.kind==="subscription"&&!i.context.fetchSubscriptions)(n));return ae([r,a])},ua=e=>({client:t,forward:n,dispatchDebug:r})=>e.reduceRight((a,i)=>{var o=!1;return i({client:t,forward(s){if(R.NODE_ENV!=="production"){if(o)throw new Error("forward() must only be called once in each Exchange.");o=!0}return ye(a(ye(s)))},dispatchDebug(s){R.NODE_ENV!=="production"&&r({timestamp:Date.now(),source:i.name,...s})}})},n),da=({dispatchDebug:e})=>t=>(R.NODE_ENV!=="production"&&(t=Te(n=>{if(n.kind!=="teardown"&&R.NODE_ENV!=="production"){var r=`No exchange has handled operations of kind "${n.kind}". Check whether you've added an exchange responsible for these operations.`;R.NODE_ENV!=="production"&&e({type:"fallbackCatch",message:r,operation:n,source:"fallbackExchange"}),console.warn(r)}})(t)),P(n=>!1)(t)),fa=function e(t){if(R.NODE_ENV!=="production"&&!t.url)throw new Error("You are creating an urql-client without a url.");var n=0,r=new Map,a=new Map,i=new Set,o=[],s={url:t.url,fetchSubscriptions:t.fetchSubscriptions,fetchOptions:t.fetchOptions,fetch:t.fetch,preferGetMethod:t.preferGetMethod,requestPolicy:t.requestPolicy||"cache-first"},u=Ie();function c(p){(p.kind==="mutation"||p.kind==="teardown"||!i.has(p.key))&&(p.kind==="teardown"?i.delete(p.key):p.kind!=="mutation"&&i.add(p.key),u.next(p))}var d=!1;function l(p){if(p&&c(p),!d){for(d=!0;d&&(p=o.shift());)c(p);d=!1}}var f=p=>{var m=vn(P(g=>g.kind==="teardown"&&g.key===p.key)(u.source))(P(g=>g.operation.kind===p.kind&&g.operation.key===p.key&&(!g.operation.context._instance||g.operation.context._instance===p.context._instance))(N));return p.kind!=="query"?m=Sr(g=>!!g.hasNext)(m):m=hn(g=>{var O=ft(g);return g.stale||g.hasNext?O:ae([O,me(()=>(g.stale=!0,g))(dt(1)(P(Z=>Z.key===p.key)(u.source)))])})(m),p.kind!=="mutation"?m=pn(()=>{i.delete(p.key),r.delete(p.key),a.delete(p.key),d=!1;for(var g=o.length-1;g>=0;g--)o[g].key===p.key&&o.splice(g,1);c(oe("teardown",p,p.context))})(Te(g=>{if(g.stale){if(!g.hasNext)i.delete(p.key);else for(var O of o)if(O.key===g.operation.key){i.delete(O.key);break}}else g.hasNext||i.delete(p.key);r.set(p.key,g)})(m)):m=ut(()=>{c(p)})(m),ye(m)},_=this instanceof e?this:Object.create(e.prototype),y=Object.assign(_,{suspense:!!t.suspense,operations$:u.source,reexecuteOperation(p){if(p.kind==="teardown")l(p);else if(p.kind==="mutation")o.push(p),Promise.resolve().then(l);else if(a.has(p.key)){for(var m=!1,g=0;g{var m=a.get(p.key);m||a.set(p.key,m=f(p)),m=ut(()=>{l(p)})(m);var g=r.get(p.key);return p.kind==="query"&&g&&(g.stale||g.hasNext)?hn(ft)(ae([m,P(O=>O===r.get(p.key))(ft(g))])):m}))},executeQuery(p,m){var g=y.createRequestOperation("query",p,m);return y.executeRequestOperation(g)},executeSubscription(p,m){var g=y.createRequestOperation("subscription",p,m);return y.executeRequestOperation(g)},executeMutation(p,m){var g=y.createRequestOperation("mutation",p,m);return y.executeRequestOperation(g)},readQuery(p,m,g){var O=null;return Me(Z=>{O=Z})(y.query(p,m,g)).unsubscribe(),O},query:(p,m,g)=>y.executeQuery(Be(p,m),g),subscription:(p,m,g)=>y.executeSubscription(Be(p,m),g),mutation:(p,m,g)=>y.executeMutation(Be(p,m),g)}),S=oa;if(R.NODE_ENV!=="production"){var{next:x,source:v}=Ie();y.subscribeToDebugTarget=p=>Me(p)(v),S=x}var k=ua(t.exchanges),N=ye(k({client:y,dispatchDebug:S,forward:da({dispatchDebug:S})})(u.source));return Ar(N),y},_a={},Ct=(e,t)=>oe(e.kind,e,{...e.context,authAttempt:t});function pa(e){return({client:t,forward:n})=>{var r=new Set,a=Ie(),i=Ie(),o=new Map;function s(){c=void 0;var l=o;o=new Map,l.forEach(a.next)}function u(l){c=void 0;var f=o;o=new Map,f.forEach(_=>{i.next(Sn(_,l))})}var c,d=null;return l=>{function f(){c=Promise.resolve().then(()=>e({mutate(v,k,N){var p=t.createRequestOperation("mutation",Be(v,k),N);return mn(dt(1)(P(m=>m.operation.key===p.key&&p.context._instance===m.operation.context._instance)(ut(()=>{var m=y(p);r.add(m.context._instance),a.next(m)})(x))))},appendHeaders(v,k){var N=typeof v.context.fetchOptions=="function"?v.context.fetchOptions():v.context.fetchOptions||{};return oe(v.kind,v,{...v.context,fetchOptions:{...N,headers:{...N.headers,...k}}})}})).then(v=>{v&&(d=v),s()}).catch(v=>{_a.NODE_ENV!=="production"&&console.warn("authExchange()’s initialization function has failed, which is unexpected.\nIf your initialization function is expected to throw/reject, catch this error and handle it explicitly.\nUnless this error is handled it’ll be passed onto any `OperationResult` instantly and authExchange() will block further operations and retry.",v),u(v)})}f();function _(v){o.set(v.key,Ct(v,!0)),d&&!c&&(c=d.refreshAuth().then(s).catch(u))}function y(v){return d?d.addAuthToOperation(v):v}var S=P(Boolean)(me(v=>v.kind==="teardown"?(o.delete(v.key),v):v.context._instance&&r.has(v.context._instance)?v:v.context.authAttempt?y(v):c||!d?(c||f(),o.has(v.key)||o.set(v.key,Ct(v,!1)),null):function(N){return!N.context.authAttempt&&d&&d.willAuthError&&d.willAuthError(N)}(v)?(_(v),null):y(Ct(v,!1)))(ae([a.source,l]))),x=n(S);return ae([i.source,P(v=>!r.has(v.operation.context._instance)&&v.error&&function(N){return d&&d.didAuthError&&d.didAuthError(N.error,N.operation)}(v)&&!v.operation.context.authAttempt?(_(v.operation),!1):(r.has(v.operation.context._instance)&&r.delete(v.operation.context._instance),!0))(x)])}}}function ha(e,t){for(var n in t)e[n]=t[n];return e}function Mn(e,t){for(var n in e)if(n!=="__source"&&!(n in t))return!0;for(var r in t)if(r!=="__source"&&e[r]!==t[r])return!0;return!1}function Ln(e,t){this.props=e,this.context=t}(Ln.prototype=new Y).isPureReactComponent=!0,Ln.prototype.shouldComponentUpdate=function(e,t){return Mn(this.props,e)||Mn(this.state,t)};var Pn=w.__b;w.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),Pn&&Pn(e)};var va=w.__e;w.__e=function(e,t,n,r){if(e.then){for(var a,i=t;i=i.__;)if((a=i.__c)&&a.__c)return t.__e==null&&(t.__e=n.__e,t.__k=n.__k),a.__c(e,t)}va(e,t,n,r)};var Fn=w.unmount;function Vn(e,t,n){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach(function(r){typeof r.__c=="function"&&r.__c()}),e.__c.__H=null),(e=ha({},e)).__c!=null&&(e.__c.__P===n&&(e.__c.__P=t),e.__c=null),e.__k=e.__k&&e.__k.map(function(r){return Vn(r,t,n)})),e}function Rn(e,t,n){return e&&n&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(r){return Rn(r,t,n)}),e.__c&&e.__c.__P===t&&(e.__e&&n.appendChild(e.__e),e.__c.__e=!0,e.__c.__P=n)),e}function St(){this.__u=0,this.t=null,this.__b=null}function Hn(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function ze(){this.u=null,this.o=null}w.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),Fn&&Fn(e)},(St.prototype=new Y).__c=function(e,t){var n=t.__c,r=this;r.t==null&&(r.t=[]),r.t.push(n);var a=Hn(r.__v),i=!1,o=function(){i||(i=!0,n.__R=null,a?a(s):s())};n.__R=o;var s=function(){if(!--r.__u){if(r.state.__a){var u=r.state.__a;r.__v.__k[0]=Rn(u,u.__c.__P,u.__c.__O)}var c;for(r.setState({__a:r.__b=null});c=r.t.pop();)c.forceUpdate()}};r.__u++||32&t.__u||r.setState({__a:r.__b=r.__v.__k[0]}),e.then(o,o)},St.prototype.componentWillUnmount=function(){this.t=[]},St.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),r=this.__v.__k[0].__c;this.__v.__k[0]=Vn(this.__b,n,r.__O=r.__P)}this.__b=null}var a=t.__a&&L(F,null,e.fallback);return a&&(a.__u&=-33),[L(F,null,t.__a?null:e.children),a]};var jn=function(e,t,n){if(++n[1]===n[0]&&e.o.delete(t),e.props.revealOrder&&(e.props.revealOrder[0]!=="t"||!e.o.size))for(n=e.u;n;){for(;n.length>3;)n.pop()();if(n[1]{let t=await Ae.getToken();return{addAuthToOperation:n=>t?e.appendHeaders(n,{"X-Shopify-Storefront-Access-Token":t.access_token}):n,didAuthError:(n,r)=>{var i;const a=(i=n.response)==null?void 0:i.status;return a===401||a===403},refreshAuth:async()=>{const n=await Ae.fetchStorefrontToken();Ae.saveTokenData(n),t=n},willAuthError:n=>!t}}),ca]});const Ue=864e5,Wn=["00","00","00","00"],Gn=({hours:e,minutes:t,seconds:n})=>{const r=new Date;return r.setHours(r.getHours()+e),r.setMinutes(r.getMinutes()+t),r.setSeconds(r.getSeconds()+n),r},Na=e=>e.map(t=>t.toString().padStart(2,"0")),Ea=(e,t="d:h:m:s")=>{const n=t.includes("d")?Math.floor(e%Ue/36e5):Math.floor(e/36e5),r=t.includes("h")?Math.floor(e%(1e3*60*60)/(1e3*60)):Math.floor(e/(1e3*60));return Na([Math.floor(e/Ue),n>999?999:n,r>999?999:r,Math.floor(e%(1e3*60)/1e3)])},Zn=jt(void 0),Nt=()=>Qt(Zn),Oa=({children:e})=>{const{isPreview:t,bootstrap:{widgetId:n},settings:{timer:r,type:a,content:{items:i}}}=W(),o=i.find(m=>m.type==="timer").unitFormat||"d:h:m:s",[s,u]=re(0),c=Oe(()=>{u(m=>m+1)},[]),d=fr(),[l,f]=re(Wn),[_,y]=re(!1),[S,x]=re(!1),v=Oe((m=!1)=>{const g=ve.loadData(n);if(g.endDate&&(new Date().getTime()-g.endDate.getTime()>Ue||!m)){const O=Gn(r);ve.saveData({endDate:O,hash:JSON.stringify(r)},n),c()}},[n,r,c]),k=Oe(()=>{clearInterval(d.current);const{mode:m,onEnd:g}=r;m==="evergreen"&&(["restart","wait_one_day"].includes(g)||t)&&v(g==="wait_one_day"&&!t),(g==="none"||g==="restart")&&y(!0),g==="hide"&&y(!1)},[r,t,v]);Ne(()=>{let m=new Date(r.date),g=null;const O=ve.loadData(n);O!=null&&O.closeDate&&(g=new Date(O.closeDate)),r.mode==="evergreen"&&(!O.endDate||O.hash!==JSON.stringify(r)?(m=Gn(r),ve.saveData({endDate:m,hash:JSON.stringify(r,null)},n)):m=O.endDate);const Z=()=>{var z;if(S)return;const fe=m.getTime()-new Date().getTime();if(fe>0){y(!0),f(Ea(fe,o));return}f(Wn),k(),((z=window.Shopify)!=null&&z.designMode||t)&&y(!0)};return(a!=="bar"||!g||new Date().getTime()-g.getTime()>Ue)&&(d.current=setInterval(Z,500),Z()),()=>clearInterval(d.current)},[k,r,o,n,t,s,a,S]);const N=Oe(()=>{ve.setCloseDate(new Date,n),y(!1),x(!0)},[n]),p=Ee(()=>({show:_,labels:l,close:N}),[l,_,N]);return h(Zn.Provider,{value:p,children:e})};function Jn(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t{const{backgroundStyle:s,overlayStyle:u}=ot(t);return` .gta-banner.${o} { border: ${e.enabled?`${e.size} solid ${e.color}`:"initial"}; margin: ${A(a.desktop)}; padding: ${A(r.desktop)}; ${n.enabled?`border-radius: ${n.value};`:""} ${s} } .gta-banner__overlay.${o} { ${u} } @media screen and (max-width: ${i}) { .gta-banner.${o} { margin: ${A(a.mobile)}; padding: ${A(r.mobile)}; } } `},Aa=({children:e})=>{const{settings:{section:t,general:{breakpoint:n}},bootstrap:{blockId:r}}=W();return t?h(F,{children:[h("style",{children:Da(t,n,r)}),h("div",{className:`gta-banner ${r}`,children:[h("div",{className:`gta-banner__content-wrap ${r}`,children:e}),h("div",{className:`gta-banner__overlay ${r}`,children:[h("div",{})," "]})]})]}):null},Ta=(e,t,n)=>{const{background:r,border:a}=e;return` .gta-content__button-container.${e.id} { width: ${e.width==="full"?"100%":"auto"}; } .gta-content__button.${e.id} { font-family: ${he(e.fontFamily,t,n)}; font-size: ${e.desktopFontSize}; font-weight: ${e.fontWeight}; color: ${e.textColor}; box-sizing: border-box; padding: ${A(e.padding.desktop)}; margin: ${e.margin?A(e.margin.desktop):"unset"}; background-color: ${r.enabled?r.color:"transparent"}; border: ${a.enabled?`${a.size} solid ${a.color}`:"none"}; width: ${e.width==="full"?"100%":"auto"}; text-transform: ${e.textTransform}; letter-spacing: ${e.desktopLetterSpacing}; ${e.radius.enabled?`border-radius: ${e.radius.value};`:""} ${r.enabled&&parseInt(r.blur)>0?`backdrop-filter: blur(${r.blur}); -webkit-backdrop-filter: blur(${r.blur});`:""} } .gta-content__button.${e.id}:hover { color: ${e.textColor} !important; border: ${a.enabled&&`${a.size} solid ${a.color}`} !important; } @media screen and (max-width: ${t.general.breakpoint}) { .gta-content__button.${e.id} { font-size: ${e.mobileFontSize}; letter-spacing: ${e.mobileLetterSpacing}; padding: ${A(e.padding.mobile)}; margin: ${e.margin?A(e.margin.mobile):"unset"}; } } `},Qn=e=>{const{settings:t,isPreview:n,bootstrap:{selectedItemId:r,onItemSelect:a}}=W();return e.label?h("div",{className:E("gta-content__button-container",e.id,{"gta--selectable":n,"gta--selected":r===e.id}),children:[h("style",{children:Ta(e,t,n)}),h("a",{...n?{onClick:()=>a==null?void 0:a(e.id)}:{href:wr(e.href)},target:e.target,className:E("gta-content__button",e.id),children:e.label})]}):null},Ia=({color:e,onClick:t})=>h("button",{onClick:t,className:"gta-content__close-btn","aria-label":"Close timer bar",children:h("svg",{viewBox:"0 0 16 16",fill:"none",children:[h("path",{d:"M14 2L2 14ZM14 14L2 2Z",fill:"black",style:"fill:black;fill-opacity:1;"}),h("path",{d:"M14 2L2 14M14 14L2 2",stroke:e,style:`stroke:${e};stroke-opacity:1;`,"stroke-width":"2"})]})}),Ma=e=>L("svg",{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",...e},L("path",{d:"M19.96 8.96002C19.29 8.22002 18.28 7.79002 16.88 7.64002V6.88002C16.88 5.51002 16.3 4.19002 15.28 3.27002C14.25 2.33002 12.91 1.89002 11.52 2.02002C9.12999 2.25002 7.11999 4.56002 7.11999 7.06002V7.64002C5.71999 7.79002 4.70999 8.22002 4.03999 8.96002C3.06999 10.04 3.09999 11.48 3.20999 12.48L3.90999 18.05C4.11999 20 4.90999 22 9.20999 22H14.79C19.09 22 19.88 20 20.09 18.06L20.79 12.47C20.9 11.48 20.92 10.04 19.96 8.96002ZM11.66 3.41002C12.66 3.32002 13.61 3.63002 14.35 4.30002C15.08 4.96002 15.49 5.90002 15.49 6.88002V7.58002H8.50999V7.06002C8.50999 5.28002 9.97999 3.57002 11.66 3.41002ZM8.41999 13.15H8.40999C7.85999 13.15 7.40999 12.7 7.40999 12.15C7.40999 11.6 7.85999 11.15 8.40999 11.15C8.96999 11.15 9.41999 11.6 9.41999 12.15C9.41999 12.7 8.96999 13.15 8.41999 13.15ZM15.42 13.15H15.41C14.86 13.15 14.41 12.7 14.41 12.15C14.41 11.6 14.86 11.15 15.41 11.15C15.97 11.15 16.42 11.6 16.42 12.15C16.42 12.7 15.97 13.15 15.42 13.15Z",fill:"currentColor"})),La=e=>L("svg",{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",...e},L("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M18.84 5.58006H19.24C20.13 5.58006 22 5.58006 22 8.14006C22 9.82006 21.36 10.4201 20.52 10.6201C20.24 10.6801 19.95 10.7001 19.64 10.7001H4.36C4.06 10.7001 3.75 10.6901 3.46 10.6201C3.15 10.5501 2.86 10.4201 2.62 10.1701C2.2 9.75006 2 9.11006 2 8.14006C2 5.58006 3.87 5.58006 4.77 5.58006H5.17L8.54 2.20006C8.82 1.93006 9.26 1.93006 9.53 2.20006C9.8 2.48006 9.8 2.92006 9.53 3.19006L7.14 5.58006H16.86L14.47 3.19006C14.2 2.91006 14.2 2.47006 14.47 2.20006C14.75 1.93006 15.19 1.93006 15.46 2.20006L18.84 5.58006ZM4.86991 12H19.0499C19.6799 12 20.1499 12.57 20.0299 13.19L19.0199 18.42C18.6599 20.31 18.0599 22 14.6899 22H9.07991C5.74991 22 4.99991 20.02 4.71991 18.3L3.87991 13.16C3.77991 12.55 4.24991 12 4.86991 12ZM9.91991 19.15C10.2999 19.15 10.6099 18.84 10.6099 18.45V15.15C10.6099 14.77 10.2999 14.45 9.91991 14.45C9.52991 14.45 9.21991 14.77 9.21991 15.15V18.45C9.21991 18.84 9.52991 19.15 9.91991 19.15ZM14.1899 19.15C14.5799 19.15 14.8899 18.84 14.8899 18.45V15.15C14.8899 14.77 14.5799 14.45 14.1899 14.45C13.8099 14.45 13.4899 14.77 13.4899 15.15V18.45C13.4899 18.84 13.8099 19.15 14.1899 19.15Z",fill:"currentColor"})),Pa=e=>L("svg",{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",...e},L("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12.9 2H17.1C20.6 2 22 3.4 22 6.9V11.1C22 14.1831 20.9059 15.629 18.261 15.9303C17.7077 15.9933 17.25 15.535 17.25 14.9781V12.9C17.25 8.7 15.3 6.75 11.1 6.75H9.02191C8.465 6.75 8.00673 6.29235 8.06975 5.73901C8.37099 3.09409 9.81693 2 12.9 2ZM16 17.1V12.9C16 9.4 14.6 8 11.1 8H6.9C3.4 8 2 9.4 2 12.9V17.1C2 20.6 3.4 22 6.9 22H11.1C14.6 22 16 20.6 16 17.1Z",fill:"currentColor"})),Fa=e=>L("svg",{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",...e},L("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M14.5 17.1V12.9C14.5 11.2979 14.1704 10.5667 13.8018 10.1982C13.4333 9.8296 12.7021 9.5 11.1 9.5H6.9C5.29794 9.5 4.56672 9.8296 4.19816 10.1982C3.8296 10.5667 3.5 11.2979 3.5 12.9V17.1C3.5 18.7021 3.8296 19.4333 4.19816 19.8018C4.56672 20.1704 5.29794 20.5 6.9 20.5H11.1C12.7021 20.5 13.4333 20.1704 13.8018 19.8018C14.1704 19.4333 14.5 18.7021 14.5 17.1ZM16 12.9V17.1C16 20.6 14.6 22 11.1 22H6.9C3.4 22 2 20.6 2 17.1V12.9C2 9.4 3.4 8 6.9 8H11.1C14.6 8 16 9.4 16 12.9Z",fill:"currentColor"}),L("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.5053 3.50533C11.0398 3.97086 10.75 4.77397 10.75 6.2H9.25C9.25 4.62603 9.5602 3.32914 10.4447 2.44467C11.3291 1.5602 12.626 1.25 14.2 1.25H17.8C19.374 1.25 20.6709 1.5602 21.5553 2.44467C22.4398 3.32914 22.75 4.62603 22.75 6.2V9.8C22.75 11.374 22.4398 12.6709 21.5553 13.5553C20.6709 14.4398 19.374 14.75 17.8 14.75V13.25C19.226 13.25 20.0291 12.9602 20.4947 12.4947C20.9602 12.0291 21.25 11.226 21.25 9.8V6.2C21.25 4.77397 20.9602 3.97086 20.4947 3.50533C20.0291 3.0398 19.226 2.75 17.8 2.75H14.2C12.774 2.75 11.9709 3.0398 11.5053 3.50533Z",fill:"currentColor"})),Va=e=>L("svg",{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",...e},L("path",{d:"M21.3 10.84C21.69 10.84 22 10.53 22 10.14V9.20999C22 5.10999 20.75 3.85999 16.65 3.85999H7.35C3.25 3.85999 2 5.10999 2 9.20999V9.67999C2 10.07 2.31 10.38 2.7 10.38C3.6 10.38 4.33 11.11 4.33 12.01C4.33 12.91 3.6 13.63 2.7 13.63C2.31 13.63 2 13.94 2 14.33V14.8C2 18.9 3.25 20.15 7.35 20.15H16.65C20.75 20.15 22 18.9 22 14.8C22 14.41 21.69 14.1 21.3 14.1C20.4 14.1 19.67 13.37 19.67 12.47C19.67 11.57 20.4 10.84 21.3 10.84ZM9 8.87999C9.55 8.87999 10 9.32999 10 9.87999C10 10.43 9.56 10.88 9 10.88C8.45 10.88 8 10.43 8 9.87999C8 9.32999 8.44 8.87999 9 8.87999ZM15 15.88C14.44 15.88 13.99 15.43 13.99 14.88C13.99 14.33 14.44 13.88 14.99 13.88C15.54 13.88 15.99 14.33 15.99 14.88C15.99 15.43 15.56 15.88 15 15.88ZM15.9 9.47999L9.17 16.21C9.02 16.36 8.83 16.43 8.64 16.43C8.45 16.43 8.26 16.36 8.11 16.21C7.82 15.92 7.82 15.44 8.11 15.15L14.84 8.41999C15.13 8.12999 15.61 8.12999 15.9 8.41999C16.19 8.70999 16.19 9.18999 15.9 9.47999Z",fill:"currentColor"})),Ra=e=>L("svg",{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",...e},L("path",{d:"M21.5299 10.87L20.0099 9.35001C19.7499 9.09 19.5399 8.58001 19.5399 8.22001V6.06C19.5399 5.18 18.8199 4.46 17.9399 4.46H15.7899C15.4299 4.46 14.9199 4.25 14.6599 3.99L13.1399 2.47C12.5199 1.85 11.4999 1.85 10.8799 2.47L9.33988 3.99C9.08988 4.25 8.57988 4.46 8.20988 4.46H6.05988C5.17988 4.46 4.45988 5.18 4.45988 6.06V8.21C4.45988 8.57 4.24988 9.08 3.98988 9.34L2.46988 10.86C1.84988 11.48 1.84988 12.5 2.46988 13.12L3.98988 14.64C4.24988 14.9 4.45988 15.41 4.45988 15.77V17.92C4.45988 18.8 5.17988 19.52 6.05988 19.52H8.20988C8.56988 19.52 9.07988 19.73 9.33988 19.99L10.8599 21.51C11.4799 22.13 12.4999 22.13 13.1199 21.51L14.6399 19.99C14.8999 19.73 15.4099 19.52 15.7699 19.52H17.9199C18.7999 19.52 19.5199 18.8 19.5199 17.92V15.77C19.5199 15.41 19.7299 14.9 19.9899 14.64L21.5099 13.12C22.1599 12.51 22.1599 11.49 21.5299 10.87ZM7.99988 9C7.99988 8.45 8.44988 8 8.99988 8C9.54988 8 9.99988 8.45 9.99988 9C9.99988 9.55 9.55988 10 8.99988 10C8.44988 10 7.99988 9.55 7.99988 9ZM9.52988 15.53C9.37988 15.68 9.18988 15.75 8.99988 15.75C8.80988 15.75 8.61988 15.68 8.46988 15.53C8.17988 15.24 8.17988 14.76 8.46988 14.47L14.4699 8.47001C14.7599 8.18001 15.2399 8.18001 15.5299 8.47001C15.8199 8.76 15.8199 9.24 15.5299 9.53L9.52988 15.53ZM14.9999 16C14.4399 16 13.9899 15.55 13.9899 15C13.9899 14.45 14.4399 14 14.9899 14C15.5399 14 15.9899 14.45 15.9899 15C15.9899 15.55 15.5499 16 14.9999 16Z",fill:"currentColor"})),Ha=e=>L("svg",{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",...e},L("path",{d:"M19.83 8.70005L15.3 4.17005C14.35 3.22005 13.04 2.71005 11.7 2.78005L6.69998 3.02005C4.69998 3.11005 3.10998 4.70005 3.00998 6.69005L2.76998 11.69C2.70998 13.03 3.20998 14.34 4.15998 15.29L8.68997 19.82C10.55 21.68 13.57 21.68 15.44 19.82L19.83 15.43C21.7 13.58 21.7 10.56 19.83 8.70005ZM9.49998 12.38C7.91998 12.38 6.61998 11.09 6.61998 9.50005C6.61998 7.91005 7.91998 6.62005 9.49998 6.62005C11.08 6.62005 12.38 7.91005 12.38 9.50005C12.38 11.09 11.08 12.38 9.49998 12.38ZM17.53 13.53L13.53 17.53C13.38 17.68 13.19 17.75 13 17.75C12.81 17.75 12.62 17.68 12.47 17.53C12.18 17.24 12.18 16.76 12.47 16.47L16.47 12.47C16.76 12.18 17.24 12.18 17.53 12.47C17.82 12.76 17.82 13.24 17.53 13.53Z",fill:"currentColor"})),ja=()=>t=>fetch(`/discount/${encodeURI(t)}`,{redirect:"manual"}),qa=()=>{const[e,t]=re(!1);return{isCopying:e,copyToClipboard:async({text:r,options:{waitForAnimations:a}})=>{if(t(!0),a){const i=()=>{Promise.all(a.getAnimations({subtree:!0}).map(o=>o.finished)).finally(()=>t(!1))};a.addEventListener("animationstart",i,{once:!0})}await(navigator==null?void 0:navigator.clipboard.writeText(r)),a||t(!1)}}},Ba=(e,t,n)=>{const{background:r,border:a}=e,i=t.content.background;let o;"source"in i?o=i.source==="color"?i.bgColor:"green":o=i.color;const s=lt(e.textColor),u=lt(r.color),c=lt(o),d=i.enabled&&(c==null?void 0:c.a)!==0,l=r.enabled&&(u==null?void 0:u.a)!==0;let f=d?o:"green";return l&&(s==null?void 0:s.rgb)!==(u==null?void 0:u.rgb)&&(f=r.color),` .gta-coupon.${e.id} { font-family: ${he(e.fontFamily,t,n)}; font-size: ${e.desktopFontSize}; font-weight: ${e.fontWeight}; text-transform: ${e.textTransform}; color: ${e.textColor}; padding: ${A(e.padding.desktop)}; margin: ${e.margin?A(e.margin.desktop):"unset"}; background-color: ${r.enabled?r.color:"transparent"}; border: ${a.enabled?`${a.size} dashed ${a.color}`:"none"}; ${e.radius.enabled?`border-radius: ${e.radius.value};`:""} gap: ${parseInt(e.desktopFontSize)*.25}px; } @media screen and (max-width: ${t.general.breakpoint}) { .gta-coupon.${e.id} { font-size: ${e.mobileFontSize}; padding: ${A(e.padding.mobile)}; margin: ${e.margin?A(e.margin.mobile):"unset"}; gap: ${parseInt(e.mobileFontSize)*.25}px; } } .${e.id} .gta-coupon__checkmark-icon { stroke: ${f}; } .${e.id} .gta-coupon__checkmark { background-color: ${e.textColor}; } `},za={copy:Pa,"copy-outlined":Fa,bag:Ma,basket:La,discount:Va,"discount-star":Ra,tag:Ha},Yn=e=>{const{settings:t,isPreview:n,bootstrap:{selectedItemId:r,onItemSelect:a}}=W(),i=ja(),{isCopying:o,copyToClipboard:s}=qa();if(!e.code)return null;const u=async({currentTarget:c})=>{try{await s({text:e.code,options:{waitForAnimations:c}}),await i(e.code)}catch(d){console.log("Coupon code error",d)}};return h(F,{children:[h("style",{children:Ba(e,t,n)}),h("button",{type:"button",onClick:n?()=>a==null?void 0:a(e.id):u,className:E("gta-content__coupon gta-coupon",e.id,{"gta--selectable":n,"gta--selected":r===e.id,"gta-coupon--animating":o}),children:[e.icon.enabled&&h("div",{className:"gta-coupon__icon",children:za[e.icon.type]()}),e.label?e.label:e.code,h("div",{className:"gta-coupon__checkmark"}),h("svg",{className:"gta-coupon__checkmark-icon",xmlns:"http://www.w3.org/2000/svg",viewBox:"10 11 32 32",children:h("path",{fill:"none",d:"M14.1 27.2l7.1 7.2 16.7-16.8"})})]})]})},Ua=(e,t,n)=>` .gta-content__text.${e.id} { width: ${t.type==="bar"?"auto":"100%"}; text-align: ${t.content.align}; font-family: ${he(e.fontFamily,t,n)}; font-size: ${e.desktopFontSize}; font-weight: ${e.fontWeight}; line-height: ${e.desktopLineHeight??e.lineHeight}; color: ${e.color}; text-transform: ${e.textTransform}; letter-spacing: ${e.desktopLetterSpacing}; padding: ${A(e.padding.desktop)}; box-sizing: border-box; } @media screen and (max-width: ${t.general.breakpoint}) { .gta-content__text.${e.id} { font-size: ${e.mobileFontSize}; letter-spacing: ${e.mobileLetterSpacing}; padding: ${A(e.padding.mobile)}; line-height: ${e.mobileLineHeight??e.lineHeight}; ${t.type==="bar"?"text-align: center;":""} } } `,Kn=e=>{const{settings:t,isPreview:n,bootstrap:{selectedItemId:r,onItemSelect:a}}=W();return h(F,{children:[h("style",{children:Ua(e,t,n)}),h("div",{...n&&{onClick:()=>a==null?void 0:a(e.id)},className:E("gta-content__text",e.id,{"gta--selectable":n,"gta--selected":r===e.id}),children:e.value})]})},Wa=({id:e,digits:t,labels:n,border:r,radius:a,background:i,layout:o,separator:s,desktopWidth:u,mobileWidth:c,padding:d,margin:l},f,_)=>` .gta-content__timer.${e} { border: ${r.enabled&&o==="stacked"?`${r.size} solid ${r.color}`:"unset"}; background-color: ${o==="stacked"&&i.enabled?i.color:"unset"}; width: ${u}; margin: ${A(l.desktop)}; padding: ${A(d.desktop)}; box-sizing: border-box; ${o==="stacked"&&a.enabled?`border-radius: ${a.value};`:""} ${i.enabled&&o==="stacked"&&parseInt(i.blur)>0?`backdrop-filter: blur(${i.blur});`:""} -webkit-backdrop-filter: none; } .gta-timer__wrapper.${e} { gap: ${s.enabled?"6px":"12px"}; } .gta-timer__unit.${e} { border: ${r.enabled&&o==="separate"?`${r.size} solid ${r.color}`:"unset"}; background-color: ${o==="separate"&&i.enabled?i.color:"unset"}; ${i.enabled&&o==="separate"&&parseInt(i.blur)>0?`backdrop-filter: blur(${i.blur});`:""} -webkit-backdrop-filter: none; ${o==="separate"&&a.enabled?`border-radius: ${a.value};`:""} } .gta-timer__unit-value.${e} { color: ${t.color}; font-size: ${t.fontSize}; font-family: ${he(t.fontFamily,f,_)}; font-weight: ${t.fontWeight}; } .gta-timer__unit-label.${e} { color: ${n.color}; font-size: ${n.fontSize}; font-family: ${he(n.fontFamily,f,_)}; font-weight: ${n.fontWeight}; text-transform: ${n.textTransform}; } .gta-timer__separator.${e} { color: ${s.color}; padding-bottom: 5px; } @media screen and (max-width: ${f.general.breakpoint}) { .gta-content__timer.${e} { width: ${c}; margin: ${A(l.mobile)}; padding: ${A(d.mobile)}; } } `,Xn=e=>{const{settings:t,isPreview:n,bootstrap:{selectedItemId:r,onItemSelect:a}}=W(),{labels:i,unitFormat:o="d:h:m:s"}=e,s=e.separator.enabled,u=i.enabled,{labels:[c,d,l,f]}=Nt(),_=o.includes("d"),y=o.includes("h");return h(F,{children:[h("style",{children:Wa(e,t,n)}),h("div",{...n&&{onClick:()=>a==null?void 0:a(e.id)},className:E("gta-content__timer",e.id,{"gta--selectable":n,"gta--selected":r===e.id}),children:h("svg",{class:"gta-timer__svg",height:"100%",viewBox:`0 0 ${_?500:y?370:240} ${s?108:118}`,preserveAspectRatio:"xMinYMin meet",children:h("foreignObject",{width:"99.9%",height:"100%",xmlns:"http://www.w3.org/1999/xhtml",children:h("div",{className:E("gta-timer__wrapper",e.id),children:[_&&h(F,{children:[h("div",{className:E("gta-timer__unit",e.id),children:[h("h4",{className:E("gta-timer__unit-value",e.id),"data-timer-days":!0,children:c}),u&&h("div",{className:E("gta-timer__unit-label",e.id),children:i.days})]}),s&&h("div",{className:E("gta-timer__separator",e.id),children:":"})]}),y&&h(F,{children:[h("div",{className:E("gta-timer__unit",e.id),children:[h("h4",{className:E("gta-timer__unit-value",e.id),"data-timer-hours":!0,children:d}),u&&h("div",{className:E("gta-timer__unit-label",e.id),children:i.hours})]}),s&&h("div",{className:E("gta-timer__separator",e.id),children:":"})]}),h("div",{className:E("gta-timer__unit",e.id),children:[h("h4",{className:E("gta-timer__unit-value",e.id),"data-timer-minutes":!0,children:l}),u&&h("div",{className:E("gta-timer__unit-label",e.id),children:i.minutes})]}),s&&h("div",{className:E("gta-timer__separator",e.id),children:":"}),h("div",{className:E("gta-timer__unit",e.id),children:[h("h4",{className:E("gta-timer__unit-value",e.id),"data-timer-seconds":!0,children:f}),u&&h("div",{className:E("gta-timer__unit-label",e.id),children:i.seconds})]})]})})})})]})},Ga=({content:{background:e,padding:t,border:n,radius:r},general:{breakpoint:a},bar:i,key:o},s)=>{const{backgroundStyle:u,overlayStyle:c}=ot(e);return` .gta-widget.gta-bar.${o} { position: ${i.sticky?"sticky":"relative"}; top: ${i.position==="top"?"0":"unset"}; bottom: ${i.position==="bottom"?"0":"unset"}; right: 0; left: 0; z-index: 90; width: 100%; } .gta-content__container.${s} { display: grid; grid-template-columns: ${i.closeButton.enabled?"40px 1fr 40px":"1fr"}; border: ${n.enabled?`${n.size} solid ${n.color}`:"initial"}; ${r.enabled?`border-radius: ${r.value};`:""} ${u} } .gta-content__overlay.${s} { ${c} } .gta-bar__close-btn-container { display: flex; justify-content: center; align-items: center; } .gta-content.${s} { display: flex; padding: ${A(t.desktop)}; justify-content: ${i.justify}; align-items: center; } .gta-content__bar-texts.${s} { display: flex; flex-flow: column nowrap; } @media screen and (max-width: ${a}) { .gta-content__container.${s} { display: grid; grid-template-columns: ${i!=null&&i.closeButton.enabled?"28px 1fr 28px":"1fr"}; } .gta-content.${s} { justify-content: center; align-items: center; padding: ${A(t.mobile)}; } .gta-bar__close-btn-container { justify-content: flex-start; align-items: flex-start; padding: 8px 8px 0 0; } } `},Za=()=>{const{settings:e,bootstrap:{blockId:t},isPreview:n}=W(),{close:r}=Nt(),{content:{items:a}}=e,i=a.filter(f=>f.enabled===void 0||f.enabled),o=e.bar.closeButton.enabled,s=i.filter(f=>f.type==="text"),u=i.find(f=>f.type==="timer"),c=i.find(f=>f.type==="button"),d=i.find(f=>f.type==="coupon"),l=[...new Set(i.map(f=>f.type))];return h(F,{children:[h("style",{children:Ga(e,t)}),h("div",{className:E("gta-content__container",t),children:[o&&h("div",{children:" "}),h("div",{className:E("gta-content",t),children:l.map(f=>f==="text"&&s.length>0?h("div",{className:E("gta-content__bar-texts",t),children:s.map(_=>h(Kn,{..._}))}):f==="timer"?u&&h(Xn,{...u}):f==="button"?c&&h(Qn,{...c}):d&&h(Yn,{...d}))}),e.content.background.enabled&&h("div",{className:`gta-content__overlay ${t}`,children:[h("div",{})," "]}),o&&h("div",{className:"gta-bar__close-btn-container",children:h(Ia,{onClick:()=>n?null:r(),color:e.bar.closeButton.color})})]})]})},Ja=".gta-banner{display:flex;position:relative;box-sizing:border-box;overflow:hidden}.gta-banner__overlay,.gta-content__overlay{position:absolute;top:0;right:0;bottom:0;left:0}.gta-content__overlay{z-index:-1}.gta-banner__content-wrap{position:relative;display:flex;width:100%;justify-content:var(--gta-banner-justify-content);align-items:var(--gta-banner-align-items)}.gta-content__button{display:flex;flex-flow:row nowrap;justify-content:center;align-items:center;text-decoration:none!important;text-align:center;cursor:pointer;transition:color .2s ease,background-color .2s ease,opacity .2s ease}.gta-content__button:hover{text-decoration:none!important;opacity:.9}.gta-timer__wrapper{display:flex;flex-flow:row nowrap;justify-content:center;align-items:center;margin:0;padding:0;overflow:visible;direction:ltr}.gta-timer__svg{display:block;width:100%;height:auto;margin:0}.gta-timer__separator{font-family:serif;font-size:44px}.gta-timer__unit{display:flex;flex-flow:column nowrap;justify-content:center;align-items:center;width:160px;max-width:160px;overflow:hidden;aspect-ratio:1}.gta-timer__unit-value{line-height:1.1;text-align:center;letter-spacing:0;margin-block-start:0;margin-block-end:0}.gta-timer__unit-label{line-height:2}.gta--selected{outline:1.7px dashed #005fd3;outline-offset:2px}.gta--selectable:hover{outline:1.7px dashed #005fd3;outline-offset:2px;cursor:pointer}.gta-content__close-btn{background-color:transparent;border:none;padding:0;cursor:pointer;width:16px;height:16px;line-height:0!important;transition:all .2s}.gta-content__close-btn>svg{width:16px;height:16px}.gta-content__close-btn:hover{transform:rotate(90deg);filter:opacity(.7)}.gta-coupon{box-sizing:border-box;width:fit-content;display:flex;align-items:center;gap:.25em;cursor:pointer;position:relative;overflow:hidden}.gta-coupon.gta-coupon--animating{pointer-events:none}.gta-coupon__icon svg{display:block;width:1.2em;height:1.2em}.gta-coupon__checkmark{display:none;border-radius:50%;width:1rem;height:1rem;position:absolute;left:50%;transform:translate(-50%);background-color:#fff}.gta-coupon__checkmark-icon{display:inline;width:1.2em;height:1.2em;stroke:green;stroke-width:2;position:absolute;left:50%;transform:translate(-50%)}.gta-coupon__checkmark-icon path{vector-effect:none;transform-origin:80% 80%;stroke-dasharray:48;stroke-dashoffset:48}.gta-coupon--animating .gta-coupon__checkmark{display:flex;align-items:center;justify-content:center;animation:ripple 1.55s ease-out forwards}.gta-coupon--animating .gta-coupon__checkmark-icon path{animation:stroke .3s cubic-bezier(.65,0,.45,1) .3s forwards,scale .3s ease-in-out .4s both,strokeOpacity .3s ease-in-out 1s forwards}@keyframes ripple{0%{transform:translate(-50%);opacity:0}10%{opacity:1}40%{transform:translate(-50%) scale(50);opacity:1}70%{transform:translate(-50%) scale(50);opacity:1}to{transform:translate(-50%) scale(50);opacity:0}}@keyframes stroke{to{stroke-dashoffset:0}}@keyframes strokeOpacity{to{opacity:0}}@keyframes scale{to{transform:none}50%{transform:scale(1.15)}}",Qa=({type:e,general:{breakpoint:t}},n)=>` .gta-banner.${n}::before { content: ""; padding-bottom: var(--gta-banner-desktop-ratio); } @media screen and (max-width: ${t}) { .gta-banner.${n}::before { padding-bottom: var(--gta-banner-mobile-ratio); } } .gta-content__container.${n} { ${e==="banner"?"width: var(--gta-content-desktop-width);":""} max-width: 100%; box-sizing: border-box; position: relative; z-index: 1; } .gta-content.${n} { display: flex; flex-flow: var(--gta-content-direction) var(--gta-content-wrap); gap: var(--gta-content-desktop-gap); box-sizing: border-box; ${e==="block"?"width: var(--gta-content-desktop-width);":""} max-width: 100%; } @media screen and (max-width: ${t}) { .gta-content__container.${n} { ${e==="banner"?"width: var(--gta-content-mobile-width);":""} max-width: 100%; box-sizing: border-box; position: relative; z-index: 1; } .gta-content.${n} { ${e==="block"?"width: var(--gta-content-mobile-width);":""} gap: var(--gta-content-mobile-gap); } .gta-content__close-btn { top: 4px; right: 4px; transform: translate(0, 0); } .gta-content__close-btn:hover { transform: translate(0, 0) rotate(90deg); } } `,Ya=()=>{const{settings:e,bootstrap:{blockId:t}}=W(),n=Ee(()=>br(e,t),[e,t]);let r=e.userCss;try{r=atob(e.userCss)}catch{}return h(F,{children:[h("style",{children:n}),h("style",{children:Ja}),h("style",{children:Qa(e,t)}),h("style",{children:r})]})},Ka={button:Qn,text:Kn,timer:Xn,coupon:Yn},Xa=({type:e,content:{align:t,background:n,padding:r,border:a,radius:i},general:{breakpoint:o}},s)=>{const{backgroundStyle:u,overlayStyle:c}=ot(n);return` .gta-content__container.${s} { display: flex; overflow: hidden; padding: ${A(r.desktop)}; ${e==="block"?`justify-content: ${sn(t)};`:""} border: ${a.enabled?`${a.size} solid ${a.color}`:"initial"}; ${i.enabled?`border-radius: ${i.value};`:""} ${u} } .gta-content__overlay.${s} { ${c} } .gta-content.${s} { ${e==="banner"?"flex: 1;":""} align-items: ${sn(t)}; } @media screen and (max-width: ${o}) { .gta-content__container.${s} { padding: ${A(r.mobile)}; } } `},er=()=>{const{settings:e,bootstrap:{blockId:t}}=W();return h(F,{children:[h("style",{children:Xa(e,t)}),h("div",{className:E("gta-content__container",t),children:[e.content.background.enabled&&h("div",{className:`gta-content__overlay ${t}`,children:[h("div",{})," "]}),h("div",{className:E("gta-content",t),children:e.content.items.filter(n=>n.enabled===void 0||n.enabled).map(n=>Ka[n.type](n))})]})]})},ei=()=>{const{settings:{type:e,bar:t},bootstrap:{blockId:n}}=W();gr();const{show:r}=Nt();return r?h(F,{children:[h(Ya,{}),e==="bar"&&t?h(Za,{}):h("div",{className:E("gta-widget",n),children:e==="block"?h(er,{}):h(Aa,{children:h(er,{})})})]}):null},tr=({bootstrap:e})=>h($r,{bootstrap:e,children:h(Oa,{children:h(ei,{})})}),nr=cr.windowRuntimeKey;return window[nr]=(e,t)=>{var n,r,a;if(t!=null&&t.embed&&t.platform!=="Preview"){const i=document.createElement("div");i.className=`gta-widget gta-bar ${t.blockId}`,(n=document.querySelector("body"))==null||n.prepend(i),t.settings.bar.position==="top"?(r=document.querySelector("body"))==null||r.prepend(i):(a=document.querySelector("body"))==null||a.append(i),Ht(h(tr,{bootstrap:t}),i)}else Ht(h(tr,{bootstrap:t}),e)},Q.LIB_KEY=nr,Object.defineProperty(Q,Symbol.toStringTag,{value:"Module"}),Q}({});